package com.syx.extensiondemo.Listener;

import com.syx.extensiondemo.Constant.Constants;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.nio.charset.StandardCharsets;

@Component
public class retryListener {
    @RabbitListener(queues = Constants.RETRY_QUEUE)
    public void handlerMessage(Message message){

        long deliveryTag = message.getMessageProperties().getDeliveryTag();
        System.out.println(message.getMessageProperties().getDeliveryTag()+"++++++++++++++++++"+new String(message.getBody(), StandardCharsets.UTF_8));
        /*int num=3/0;*/

    }
}
